/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.ArrayList;
import javax.persistence.Entity;
import java.util.Collection;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 *
 * @author Andy
 */
@Entity(name = "PickList")
public class PickListEntity extends DataObjectEntity implements Serializable {

    @OneToMany(mappedBy = "pickList")
    Collection<PickingOrderEntity> pickingOrders = new ArrayList<PickingOrderEntity>();
    
    @OneToOne
    SalesOrderEntity salesOrder;

    public PickListEntity() {
        super();
    }

    public Collection<PickingOrderEntity> getPickingOrders() {
        return pickingOrders;
    }

    public void setPickingOrders(Collection<PickingOrderEntity> pickingOrders) {
        this.pickingOrders = pickingOrders;
    }

    public SalesOrderEntity getSalesOrder() {
        return salesOrder;
    }

    public void setSalesOrder(SalesOrderEntity salesOrder) {
        this.salesOrder = salesOrder;
    }

    @Override
    public String childToString() {
        return "PickListEntity{" + "pickingOrders=" + pickingOrders + ", salesOrder=" + salesOrder + '}';
    }
    
}
